package com.primestone.cim.entities.tmp;

// Generated Mar 7, 2013 12:23:19 AM by Hibernate Tools 4.0.0

import static javax.persistence.GenerationType.IDENTITY;

import java.sql.Clob;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedNativeQueries;
import javax.persistence.NamedNativeQuery;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * ResMeterReadings generated by hbm2java
 */
@Entity
@Table(name = "RES_METER_READINGS")
@NamedQueries({
  @NamedQuery(name = "ResMeterReadings.findByTicket", 
		  	  query = "select o from ResMeterReadings o where o.ticket = :ResMeterReadings_ticket"),
  @NamedQuery(name = "ResMeterReadings.deleteById", 
  	  		  query = "delete from ResMeterReadings where id = :ResMeterReadings_id")
})

@NamedNativeQueries({
	  @NamedNativeQuery(name = "ResMeterReadings.findFirstByTicket", 
			  	  query = "select top 1 o.* from res_meter_readings o where o.ticket = ? order by o.id", 
			  	  resultClass = ResMeterReadings.class),
	  @NamedNativeQuery(name = "ResMeterReadings.findNextByTicket", 
			  	  query = "select top 1 o.* from res_meter_readings o where o.ticket = ? and o.id > ? order by o.id",
			  	  resultClass = ResMeterReadings.class)
	})
public class ResMeterReadings implements java.io.Serializable {

	private static final long serialVersionUID = 427495954638950646L;
	
	private Long id;
	private String ticket;
	private String username;
	private Date jsonResultDate;
	private Clob jsonResults;

	/**
	 * 
	 */
	public ResMeterReadings() {
	}

	/**
	 * @param ticket
	 * @param username
	 * @param jsonResultDate
	 * @param jsonResults
	 */
	public ResMeterReadings(String ticket, String username,
			Date jsonResultDate, Clob jsonResults) {
		this.ticket = ticket;
		this.username = username;
		this.jsonResultDate = jsonResultDate;
		this.jsonResults = jsonResults;
	}

	/**
	 * @return
	 */
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	/**
	 * @param id
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return
	 */
	@Column(name = "TICKET", nullable = false)
	public String getTicket() {
		return this.ticket;
	}

	/**
	 * @param ticket
	 */
	public void setTicket(String ticket) {
		this.ticket = ticket;
	}

	/**
	 * @return
	 */
	@Column(name = "USERNAME", nullable = false, length = 50)
	public String getUsername() {
		return this.username;
	}

	/**
	 * @param username
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * @return
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "JSON_RESULT_DATE", nullable = false, length = 23)
	public Date getJsonResultDate() {
		return this.jsonResultDate;
	}

	/**
	 * @param jsonResultDate
	 */
	public void setJsonResultDate(Date jsonResultDate) {
		this.jsonResultDate = jsonResultDate;
	}

	/**
	 * @return
	 */
	@Column(name = "JSON_RESULTS")
	public Clob getJsonResults() {
		return this.jsonResults;
	}

	/**
	 * @param jsonResults
	 */
	public void setJsonResults(Clob jsonResults) {
		this.jsonResults = jsonResults;
	}

}
